﻿//------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using Microsoft.ResourceManagement.Samples.ResourceManagementClient.ResourceManagement;

namespace Microsoft.ResourceManagement.Samples.ResourceManagementClient.WSTransfer
{
    /// <summary>
    /// This class encapsulates a WS-Transfer CreateResponse.
    /// Please read the spec http://www.w3.org/Submission/WS-Transfer/
    /// 
    /// A client receives a CreateResponse upon a successful Create.
    /// The CreateResponse MUST contain the address of the element.
    /// ILM CreateResponses include the endpoint address and resource reference property.
    /// The CreateRespoonse MAY contain the copy of the element if it differs from the one sent in.
    /// </summary>
    public class CreateResponse
    {
        private ResourceManagementObject resourceManagementObject;

        public CreateResponse()
        {
        }

        
        public ResourceManagementObject Object
        {
            get
            {
                return resourceManagementObject;
            }
            set
            {
                this.resourceManagementObject = value;
            }
        }

        private ResourceCreated resourceCreated;
        [XmlElement(ElementName = "ResourceCreated", Namespace = Constants.NamespaceWSTransfer)]
        public ResourceCreated ResourceCreated
        {
            get
            {
                return this.resourceCreated;
            }
            set
            {
                this.resourceCreated = value;
            }
        }
    }
    
    public class ResourceCreated
    {
        private String address;
        [XmlElement(ElementName="Address",Namespace=Constants.NamespaceWSAddressing)]
        public String Address
        {
            get
            {
                return this.address;
            }
            set
            {
                this.address = value;
            }
        }
        private ReferenceProperties referenceProperties;
        [XmlElement(ElementName = "ReferenceProperties", Namespace = Constants.NamespaceResourceManagement)]
        public ReferenceProperties ReferenceProperties
        {
            get
            {
                return this.referenceProperties;
            }
            set
            {
                this.referenceProperties = value;
            }
        }
    }
}
